<template>
  <el-container>
    <el-header>
      <el-row >卡号:{{cardno}}&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" @click.prevent="exitLogin">退出登录</a> </el-row>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <br/><el-row><router-link :to="{path:'/transforMoney',query:{sendCardNo:cardno}}">转账</router-link></el-row><br/><br/>
        <el-row><a href="#">查询交易记录</a></el-row>
      </el-aside>
      <el-main>
        <h1>欢迎使用个人网上银行</h1>
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
    export default {
      name: "Home",
      data(){
        return{
          cardno:this.$route.query.cardno
        }
      },
      methods:{
        exitLogin(){
          let sure=confirm("确定要退出吗?")
          if(!sure){
            return;
          }
          this.axios({
            method:"get",
            url:"/exit/account/"+this.cardno
          }).then((res)=>{
            this.$router.push("/")
          })
        }
      }
    }
</script>

<style scoped>
  .el-header{
    text-align: left;
  }
  .el-aside{
    text-align: left;
  }
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }
</style>
